#include "battle_arena_plugin.h"
#include "BattleArena.h"

ModuleLinkerSPtr				global_module_linker_ = nullptr;
TankShowDownSPtr				global_tank_show_ = nullptr;

BattleArenaPlugin::BattleArenaPlugin(QObject* parent) : QObject(parent) {

}

BattleArenaPlugin::~BattleArenaPlugin() {

}

void BattleArenaPlugin::InitPlugin(ModuleLinkerSPtr _context_ptr)
{
	if (!global_module_linker_)
		global_module_linker_ = _context_ptr;

	BattleArenaSPtr battle_arena_ptr = std::make_shared<BattleArena>();
	global_module_linker_->SetServicePtrById(BATTLEARENASERVICEID, battle_arena_ptr);
}

void BattleArenaPlugin::StartPlugin()
{
	if (!global_module_linker_)
		return;

	global_tank_show_ = Service(ITankShowDown, TANKSHOWSERVICEID, global_module_linker_);

	return;
}